<%@ Page Language="vb" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<script  runat="server">
Sub Page_Load(sender As Object, e As EventArgs)	
Try
	Dim strConn As String
	strConn=ConfigurationSettings.appSettings("conn")
	Dim myConn As SqlConnection  = _
	New SqlConnection(strConn)
	myConn.Open	
	Dim strSQL as String
	strSQL="Select * from tblSubCategories "			
	Dim myCom As SqlCommand = _
	New SqlCommand(strSQL,myConn)
	Dim myReader As SqlDataReader = _
	myCom.ExecuteReader()
    	While myReader.Read()
		Response.Write(myReader("SubCateID"))
		Response.Write(" - ")
		Response.Write(myReader.GetString(1))
		Response.Write("<br />")
	End While
	myReader.Close
	myConn.Close
Catch objError As Exception
	outError.innerHTML = "<b>* Error</b>: " & _
	objError.Message & "<p />"
End Try
End Sub
</script>	
<html>
<head>
<title>ADO.NET </title>
</head>
<body >   
       
<div id="outError" runat="server" />
<br />
</body>
</html>
